package cuishifeng.blog;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import cuishifeng.blog.learn.spring.SpringBeanLiveDemo;

@Configuration
@ComponentScan(basePackages = "cuishifeng.blog")
public class AppConfig {

//	@Bean
//	public SpringBeanLiveDemo springBean() {
//		return new SpringBeanLiveDemo();
//	}

	public static void main(String[] args) {
		AnnotationConfigApplicationContext annotationConfigApplicationContext =
				new AnnotationConfigApplicationContext(AppConfig.class);
		SpringBeanLiveDemo springBeanLiveDemo = annotationConfigApplicationContext.getBean(SpringBeanLiveDemo.class);
		springBeanLiveDemo.selfMethod();
		annotationConfigApplicationContext.destroy();
	}
}
